package cn.com.czpb.client.module.news.activity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.LinearLayout;

import com.bumptech.glide.Glide;

import butterknife.BindView;
import butterknife.ButterKnife;
import cn.com.czpb.client.R;
import cn.com.czpb.client.app.MToolBarActivity;
import cn.com.czpb.client.custorm.TouchImageView;

/**
 * Created by 猪猪侠 on 2017/11/17.
 */

public class ImgActivity extends MToolBarActivity {

    @BindView(R.id.touch_img_id)
    TouchImageView touchImgId;
    @BindView(R.id.ll_root_id)
    LinearLayout llRootId;

    @Override
    protected int setLayoutId() {
        return R.layout.activity_img;
    }

    @Override
    protected void initData() {
        Intent intent = getIntent();
        String imgurl = intent.getStringExtra("imgurl");

        Glide.with(activity).load(imgurl).crossFade().placeholder(R.drawable.default_bg).into(touchImgId);
        touchImgId.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                ImgActivity.this.finish();
                ImgActivity.this.overridePendingTransition(android.R.anim.fade_in, android.R.anim.fade_out);
            }
        });
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        // TODO: add setContentView(...) invocation
        ButterKnife.bind(this);
    }
}
